package org.sgx.joptest.client.editable;

import java.util.Date;

import org.sgx.gwteditors.client.impl1.basetypes.Color;
import org.sgx.gwteditors.client.impl1.edbean.EditableBean;
import org.sgx.joptest.client.model.User;

import com.google.gwt.core.shared.GWT;

/**
 * editableBeans - GUI
 * 
 * @author sg
 * 
 */
public abstract class EditableUser implements EditableBean {

	String name, lastName;
	Date bornDate;
	Boolean male;
	Long id;
	Color eyeColor, hairColor;

	public static EditableUser from(User u) {
		EditableUser edu = GWT.create(EditableUser.class);
		edu.setName(u.getName()); 
		edu.setLastName(u.getLastName()); 
		edu.setBornDate(u.getBornDate()); 
		//TODO: others
		return edu;
	}
	public static User to(EditableUser u) {
		User user = new User();
		user.setName(u.getName()); 
		user.setLastName(u.getLastName()); 
		user.setBornDate(u.getBornDate());  
		//TODO: others
		return user;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getLastName() {
		return lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public Date getBornDate() {
		return bornDate;
	}

	public void setBornDate(Date bornDate) {
		this.bornDate = bornDate;
	}

	public Boolean getMale() {
		return male;
	}

	public void setMale(Boolean male) {
		this.male = male;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Color getEyeColor() {
		return eyeColor;
	}

	public void setEyeColor(Color eyeColor) {
		this.eyeColor = eyeColor;
	}

	public Color getHairColor() {
		return hairColor;
	}

	public void setHairColor(Color hairColor) {
		this.hairColor = hairColor;
	}
	
	

}
